Trampolines#1777
Open
Bike wants to merge 24 commits into
Open
Conversation
Arena-based trampolines (hand-coded x86_64), sampling profiler, flame graph generation, trampoline-aware backtraces, command-line extensions, and snapshot save/load support. Excludes bytecode interpreter changes (computed gotos, VMDynRecord dynamic binding stack) which remain on the interpreter-work branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Also demangle C++ function names
- New trampoline_aarch64.h paralleling trampoline_x86_64.h with hand-coded bytecode (36B) and GF (32B) trampolines using LDR from literal pool. Shared CIE and per-kind FDEs with full DWARF CFI for unwinding. Same instructions for Linux arm64 and Apple Silicon; macOS W^X support still needs MAP_JIT in ExecutableArena. - Wire aarch64 templates into trampolineWork.cc via #elif __aarch64__. - Demangle C++ symbols in sampling_profiler symbolicate_one via abi::__cxa_demangle for readable flame graph frames. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
At profile-start, snapshot /proc/self/maps (Linux) or dyld image list (macOS) into a sorted executable-range cache. The SIGPROF handler binary-searches each saved_rip during the frame-pointer walk: if the address isn't in any executable mapping, the chain is broken (frame compiled without -fno-omit-frame-pointer) and the walk stops cleanly instead of following garbage pointers. New JIT/arena pages registered dynamically via sampling_profiler_add_executable_range(), called from ExecutableArena::allocate() so trampolines mmap'd during profiling are immediately recognized. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wraps a body form with sampling profiler start/stop and writes a
flame graph SVG on completion. Profiler is stopped and reset via
unwind-protect on any exit path.
(ext:with-flame-profile ("/tmp/my.svg" :rate 197 :title "test")
(expensive-work))
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The .dif file stored hash used to have to match the calculated hash of the clasp_gc.sif file. That's too restrictive
Bike
commented
May 28, 2026
Rerun analyze once we move back to main
It's a wrapper that I use in the main thread and child threads created in mpPackage.cc
that used src/core/trampoline/trampoline.cc
Some code was moved to llvmoExpose.cc - I'm not sure why I had to do this now to get things to work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a facility for giving bytecodes native "trampolines" so that they are visible by name in external backtraces (e.g. perf, gdb). Supersedes #1765. drmeister has done the work here, just filing a PR so I can review it.